/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 *
 * @author micheleprola
 */
@Entity
@NamedQueries({
    @NamedQuery(name = "News.findOne", query = "SELECT n FROM News n WHERE n.id=:id"),   
})
public class News implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String titoloNews;
    @Column(length=1000)
    private String descNews;
    private Date dataNews;

    /**
     * Get the value of dataNews
     *
     * @return the value of dataNews
     */
    public Date getDataNews() {
        return dataNews;
    }

    /**
     * Set the value of dataNews
     *
     * @param dataNews new value of dataNews
     */
    public void setDataNews(Date dataNews) {
        this.dataNews = dataNews;
    }


    /**
     * Get the value of descNews
     *
     * @return the value of descNews
     */
    public String getDescNews() {
        return descNews;
    }

    /**
     * Set the value of descNews
     *
     * @param descNews new value of descNews
     */
    public void setDescNews(String descNews) {
        this.descNews = descNews;
    }


    /**
     * Get the value of titoloNews
     *
     * @return the value of titoloNews
     */
    public String getTitoloNews() {
        return titoloNews;
    }

    /**
     * Set the value of titoloNews
     *
     * @param titoloNews new value of titoloNews
     */
    public void setTitoloNews(String titoloNews) {
        this.titoloNews = titoloNews;
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof News)) {
            return false;
        }
        News other = (News) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.News[ id=" + id + " ]";
    }
    
}
